<script type="text/javascript">
	function save() {
		if ($("#name").val().length > 0) {
			$("#tag_name", parent.document).val($("#name").val());
			$("#pid", parent.document).val($("#val").val());
		} else {
			ui_error("请选择级部门");
			return false;
		}
		myclose();
	}

	$(document).ready(function() {
		parent_node = $(".sub_left_menu ul.tree_menu a.active", parent.document).attr("node");
		$("ul.tree_menu a[node='" + parent_node + "']").addClass("disabled");
		$(".popup_tree_menu a:not('.disabled')").click(function() {
			$("#val").val($(this).attr("node"));
			$("#name").val($(this).children("span").text());
			$(".tree_menu a.active").removeClass("active");
			$(this).addClass("active");
		});
	}); 
</script>